home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Eagles Nest BBS 4
/
Eagles_Nest_Mac_Collection_Disc_4.TOAST
/
Word Processing
/
WordRefBib
/
WordRef Stack 1.3
/
background_13702.txt
< prev
next >
Wrap
Text File
|
1989-12-16
|
12KB
|
517 lines
-- background: 13702 from stack: in.3
-- bmap block id: 4517
-- flags: 4000
-- background id: 0
-- name: Instruction
----- HyperTalk script -----
on openBackground
global dontCheckFields
-- Should really be in the openStack handler, but, at least for me,
-- this never gets executed!?!
if the short version of HyperCard < 1.2 then
answer "This stack needs HyperCard 1.2 or later to run." with "Sorry"
go home
end if
show menubar
hide msg box
put false into dontCheckFields
pass openBackground
end openBackground
on closeCard
hideStrings
end closeCard
on showStrings
lock screen
show bg btn "Strings"
show bg btn "stringsGoAway"
show bg fld "strings"
unlock screen with barn door open
select before text of bg fld "strings"
end showStrings
on hideStrings
if the visible of bg fld "strings" then
lock screen
hide bg fld "strings"
hide bg btn "Strings"
hide bg btn "stringsGoAway"
unlock screen with barn door close
end if
end hideStrings
-- part 85 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=288 top=162 right=177 bottom=337
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 10
-- style flags: 0
-- line height: 13
-- part name: version
-- part 80 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=205 top=305 right=335 bottom=307
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Write BibTeX…
----- HyperTalk script -----
on mouseUp
global gFileName, dontCheckFields
put rawFileName(gFileName) into rawFile
if rawFile is empty
then put the short name of this stack & ".bib" into rawFile
put StdFile(put, "Save to BibTeX file:", rawFile) into newFile
if newFile is empty then exit mouseUp
answer "Is this for use with WordRef?" with "Cancel" or "Other BibTeX" or "WordRef"
put it into doWordRef
if it is "Cancel" then exit mouseUp
if it is "WordRef" then
answer "Is the stack already sorted?" with "No" or "Yes"
if it is "No" then
put "Sorting…"
sort by field "keyField"
end if
end if
set cursor to watch
put newFile into gFileName
lock screen
put true into dontCheckFields
WriteBibTeX gFileName, doWordRef, "no"
put false into dontCheckFields
unlock screen
hide msg box
end mouseUp
-- returns the "short" name of a file name
function rawFileName fileName
put offset(":",fileName) into index
repeat while index <> 0
put the number of chars of fileName into numChars
put char index+1 to numChars of fileName into fileName
put offset(":",fileName) into index
end repeat
return fileName
end rawFileName
-- part 82 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=8 top=246 right=286 bottom=48
-- title width / last selected line: 0
-- icon id / first selected line: 8538 / 8538
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Find
----- HyperTalk script -----
on mouseUp
doMenu "Find..."
end mouseUp
-- part 84 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=407 top=305 right=335 bottom=464
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Clear…
----- HyperTalk script -----
on mouseUp
answer "Really delete all references from the stack?" with "Yes" or "No"
if it is "No" then exit mouseUp
set cursor to watch
lock screen
put the id of this card into myself
put empty into bg field "Strings"
go next
repeat until the id of this card is myself
-- clear the card if it's the last of its kind
if the number of cds of this bg = 1 then
repeat with i = 1 to the number of bg flds
put empty into bg field i
end repeat
go next
else
doMenu "Delete Card"
end if
end repeat
unlock screen
end mouseUp
-- part 86 (field)
-- low flags: 01
-- high flags: 0001
-- rect: left=107 top=45 right=82 bottom=456
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 20
-- text size: 24
-- style flags: 256
-- line height: 32
-- part name: Title
-- part 87 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=205 top=273 right=303 bottom=307
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Read BibTeX…
----- HyperTalk script -----
on mouseUp
global dontCheckFields
put StdFile(get, "TEXT") into inFile
if inFile is empty then exit mouseUp
set cursor to watch
lock screen
put true into dontCheckFields
ReadBibTeX inFile
if the result is not empty then answer the result with "OK"
put false into dontCheckFields
put "Sorting..."
sort by fld "keyField"
unlock screen
hide msg box
end mouseUp
-- part 89 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=311 top=273 right=303 bottom=464
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Find Duplicate Keys
----- HyperTalk script -----
on mouseUp
set cursor to watch
lock screen
sort by bg fld "keyField"
put empty into dupKeys
put the id of this cd into myself
go card 15
put empty into lastKey
repeat until the id of this cd is myself
if bg fld "keyField" = lastKey then
put lastKey & " " after dupKeys
end if
put bg fld "keyField" into lastKey
go next
end repeat
unlock screen
if dupKeys is empty
then put "No duplicates"
else put "Duplicates:" && dupKeys
end mouseUp
-- part 88 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=8 top=204 right=244 bottom=48
-- title width / last selected line: 0
-- icon id / first selected line: 32462 / 32462
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Help
----- HyperTalk script -----
on mouseUp
show cd fld "Help Field"
end mouseUp
-- part 90 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=70 top=17 right=57 bottom=110
-- title width / last selected line: 0
-- icon id / first selected line: 24830 / 24830
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Next
----- HyperTalk script -----
on mouseUp
lock screen
go card 15
-- put the id of this cd into myself
-- go next
-- repeat until the id of this cd is myself
-- if bg fld "keyField" is not empty then exit mouseUp
-- go next
-- end repeat
end mouseUp
-- part 91 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=311 top=305 right=335 bottom=403
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: New Stack…
----- HyperTalk script -----
on mouseUp
put the short name of this stack into source
put StdFile(put, "Save a Copy:","Copy of"&&source) into dest
if dest is empty then exit mouseUp
set cursor to watch
put word 2 of the long name of this stack into source
put char 2 to number of chars of source - 1 of source into source
CopyFile source,dest
if the result is not empty then
put "Error in copy:" && the result
exit mouseUp
end if
go dest
end mouseUp
-- part 93 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=8 top=36 right=76 bottom=48
-- title width / last selected line: 0
-- icon id / first selected line: 20098 / 20098
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Home
----- HyperTalk script -----
on mouseUp
visual iris close
go home
end mouseUp
-- part 94 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=8 top=78 right=118 bottom=48
-- title width / last selected line: 0
-- icon id / first selected line: 3430 / 3430
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: New Item
----- HyperTalk script -----
on mouseDown
NewItem 0
end mouseDown
-- part 95 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=8 top=120 right=160 bottom=48
-- title width / last selected line: 0
-- icon id / first selected line: 20186 / 20186
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Sort Items
----- HyperTalk script -----
on mouseUp
sort by fld "keyField"
end mouseUp
-- part 96 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=8 top=162 right=202 bottom=48
-- title width / last selected line: 0
-- icon id / first selected line: 32670 / 32670
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Scan Items
----- HyperTalk script -----
on mouseUp
show all cds
end mouseUp
-- part 98 (field)
-- low flags: 80
-- high flags: 0007
-- rect: left=107 top=99 right=258 bottom=454
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 21
-- text size: 10
-- style flags: 0
-- line height: 13
-- part name: Strings
-- part 99 (button)
-- low flags: 80
-- high flags: 8002
-- rect: left=107 top=78 right=100 bottom=454
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Strings
-- part 100 (button)
-- low flags: 80
-- high flags: 2005
-- rect: left=109 top=81 right=97 bottom=129
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: stringsGoAway
----- HyperTalk script -----
on mouseUp
set the highlight of me to false
hideStrings
end mouseUp
-- part 101 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=8 top=288 right=328 bottom=48
-- title width / last selected line: 0
-- icon id / first selected line: 20965 / 20965
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Edit Strings
----- HyperTalk script -----
on mouseUp
showStrings
end mouseUp
-- part 102 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=96 top=273 right=303 bottom=201
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Read Strings…
----- HyperTalk script -----
on mouseUp
put StdFile(get, "TEXT") into inFile
if inFile is empty then exit mouseUp
set cursor to watch
ReadBibTeX inFile
if the result is not empty then
answer the result with "OK"
end if
end mouseUp
-- part 103 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=96 top=305 right=335 bottom=201
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Write Strings…
----- HyperTalk script -----
on mouseUp
put StdFile(put, "Save to Strings file:") into newFile
if newFile is empty then exit mouseUp
set cursor to watch
WriteBibTeX newFile, "Other", "yes"
end mouseUp